3.11.79 \(\int \sqrt {\cos (c+d x)} (A+C \sec ^2(c+d x)) \, dx\) [1079]

Optimal. Leaf size=44 \[ \frac {2 (A-C) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 C \sin (c+d x)}{d \sqrt {\cos (c+d x)}} \]

[Out]

2*(A-C)*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticE(sin(1/2*d*x+1/2*c),2^(1/2))/d+2*C*sin(d*x+c)
/d/cos(d*x+c)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {4151, 3091, 2719} \begin {gather*} \frac {2 (A-C) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 C \sin (c+d x)}{d \sqrt {\cos (c+d x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[Cos[c + d*x]]*(A + C*Sec[c + d*x]^2),x]

[Out]

(2*(A - C)*EllipticE[(c + d*x)/2, 2])/d + (2*C*Sin[c + d*x])/(d*Sqrt[Cos[c + d*x]])

Rule 2719

Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticE[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ[{
c, d}, x]

Rule 3091

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[A*Cos[e +
 f*x]*((b*Sin[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Dist[(A*(m + 2) + C*(m + 1))/(b^2*(m + 1)), Int[(b*Sin[e
+ f*x])^(m + 2), x], x] /; FreeQ[{b, e, f, A, C}, x] && LtQ[m, -1]

Rule 4151

Int[(cos[(e_.) + (f_.)*(x_)]*(b_.))^(m_)*((A_.) + (C_.)*sec[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[b^2, Int
[(b*Cos[e + f*x])^(m - 2)*(C + A*Cos[e + f*x]^2), x], x] /; FreeQ[{b, e, f, A, C, m}, x] &&  !IntegerQ[m]

Rubi steps

\begin {align*} \int \sqrt {\cos (c+d x)} \left (A+C \sec ^2(c+d x)\right ) \, dx &=\int \frac {C+A \cos ^2(c+d x)}{\cos ^{\frac {3}{2}}(c+d x)} \, dx\\ &=\frac {2 C \sin (c+d x)}{d \sqrt {\cos (c+d x)}}-(-A+C) \int \sqrt {\cos (c+d x)} \, dx\\ &=\frac {2 (A-C) E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 C \sin (c+d x)}{d \sqrt {\cos (c+d x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 4 in optimal.
time = 1.78, size = 289, normalized size = 6.57 \begin {gather*} \frac {\cos ^2(c+d x) \left (A+C \sec ^2(c+d x)\right ) \left (-\frac {4 ((A-2 C) \cos (d x)+A \cos (2 c+d x)) \csc (c)}{d \sqrt {\cos (c+d x)}}+\frac {2 (A-C) \csc \left (\frac {c}{2}\right ) \left (3 \, _2F_1\left (-\frac {1}{4},\frac {1}{2};\frac {3}{4};-e^{2 i d x} (\cos (c)+i \sin (c))^2\right )+e^{2 i d x} \, _2F_1\left (\frac {1}{2},\frac {3}{4};\frac {7}{4};-e^{2 i d x} (\cos (c)+i \sin (c))^2\right )\right ) \sec \left (\frac {c}{2}\right ) \sqrt {e^{-i d x} \left (2 \left (1+e^{2 i d x}\right ) \cos (c)+2 i \left (-1+e^{2 i d x}\right ) \sin (c)\right )} \sqrt {1+e^{2 i d x} \cos (2 c)+i e^{2 i d x} \sin (2 c)}}{3 d \left (\left (1+e^{2 i d x}\right ) \cos (c)+i \left (-1+e^{2 i d x}\right ) \sin (c)\right )}\right )}{2 (A+2 C+A \cos (2 (c+d x)))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[Cos[c + d*x]]*(A + C*Sec[c + d*x]^2),x]

[Out]

(Cos[c + d*x]^2*(A + C*Sec[c + d*x]^2)*((-4*((A - 2*C)*Cos[d*x] + A*Cos[2*c + d*x])*Csc[c])/(d*Sqrt[Cos[c + d*
x]]) + (2*(A - C)*Csc[c/2]*(3*Hypergeometric2F1[-1/4, 1/2, 3/4, -(E^((2*I)*d*x)*(Cos[c] + I*Sin[c])^2)] + E^((
2*I)*d*x)*Hypergeometric2F1[1/2, 3/4, 7/4, -(E^((2*I)*d*x)*(Cos[c] + I*Sin[c])^2)])*Sec[c/2]*Sqrt[(2*(1 + E^((
2*I)*d*x))*Cos[c] + (2*I)*(-1 + E^((2*I)*d*x))*Sin[c])/E^(I*d*x)]*Sqrt[1 + E^((2*I)*d*x)*Cos[2*c] + I*E^((2*I)
*d*x)*Sin[2*c]])/(3*d*((1 + E^((2*I)*d*x))*Cos[c] + I*(-1 + E^((2*I)*d*x))*Sin[c]))))/(2*(A + 2*C + A*Cos[2*(c
 + d*x)]))

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(148\) vs. \(2(68)=136\).
time = 0.09, size = 149, normalized size = 3.39

method result size
default \(\frac {2 A \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )+4 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) C -2 C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d}\) \(149\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^(1/2)*(A+C*sec(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

2*(A*(sin(1/2*d*x+1/2*c)^2)^(1/2)*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*EllipticE(cos(1/2*d*x+1/2*c),2^(1/2))+2*sin
(1/2*d*x+1/2*c)^2*cos(1/2*d*x+1/2*c)*C-C*(sin(1/2*d*x+1/2*c)^2)^(1/2)*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*Ellipti
cE(cos(1/2*d*x+1/2*c),2^(1/2)))/sin(1/2*d*x+1/2*c)/(2*cos(1/2*d*x+1/2*c)^2-1)^(1/2)/d

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^(1/2)*(A+C*sec(d*x+c)^2),x, algorithm="maxima")

[Out]

integrate((C*sec(d*x + c)^2 + A)*sqrt(cos(d*x + c)), x)

________________________________________________________________________________________

Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order 4.
time = 0.91, size = 106, normalized size = 2.41 \begin {gather*} \frac {\sqrt {2} {\left (i \, A - i \, C\right )} \cos \left (d x + c\right ) {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) + i \, \sin \left (d x + c\right )\right )\right ) + \sqrt {2} {\left (-i \, A + i \, C\right )} \cos \left (d x + c\right ) {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (d x + c\right ) - i \, \sin \left (d x + c\right )\right )\right ) + 2 \, C \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right )}{d \cos \left (d x + c\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^(1/2)*(A+C*sec(d*x+c)^2),x, algorithm="fricas")

[Out]

(sqrt(2)*(I*A - I*C)*cos(d*x + c)*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos(d*x + c) + I*sin(d*x +
 c))) + sqrt(2)*(-I*A + I*C)*cos(d*x + c)*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos(d*x + c) - I*s
in(d*x + c))) + 2*C*sqrt(cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (A + C \sec ^{2}{\left (c + d x \right )}\right ) \sqrt {\cos {\left (c + d x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**(1/2)*(A+C*sec(d*x+c)**2),x)

[Out]

Integral((A + C*sec(c + d*x)**2)*sqrt(cos(c + d*x)), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^(1/2)*(A+C*sec(d*x+c)^2),x, algorithm="giac")

[Out]

integrate((C*sec(d*x + c)^2 + A)*sqrt(cos(d*x + c)), x)

________________________________________________________________________________________

Mupad [B]
time = 5.19, size = 60, normalized size = 1.36 \begin {gather*} \frac {2\,A\,\mathrm {E}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d}+\frac {2\,C\,\sin \left (c+d\,x\right )\,{{}}_2{\mathrm {F}}_1\left (-\frac {1}{4},\frac {1}{2};\ \frac {3}{4};\ {\cos \left (c+d\,x\right )}^2\right )}{d\,\sqrt {\cos \left (c+d\,x\right )}\,\sqrt {{\sin \left (c+d\,x\right )}^2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^(1/2)*(A + C/cos(c + d*x)^2),x)

[Out]

(2*A*ellipticE(c/2 + (d*x)/2, 2))/d + (2*C*sin(c + d*x)*hypergeom([-1/4, 1/2], 3/4, cos(c + d*x)^2))/(d*cos(c
+ d*x)^(1/2)*(sin(c + d*x)^2)^(1/2))

________________________________________________________________________________________